import { defineStore } from "pinia";
import { ref } from 'vue'

export const onlineUserStore = defineStore('onlineUser', () => {

    // 存放用户对象
    const onlineUser = ref([])

    const setUser = (user) => {
        if (user !== null) {
            onlineUser.value.push(user)
        }
    }

    return {
        onlineUser,
        setUser
    }
})